package com.cvte.shop.lock;

import com.cvte.csb.jdbc.mybatis.annotation.CSBVersionLocker;
import lombok.Data;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author DaiShubo
 * @version 1.0
 * @description 乐观锁
 * @createTime 2020/7/27 7:27 下午
 * @since 1.7
 **/
@Data
@Table(name = "SHOP_LOCK")
@CSBVersionLocker // 开启乐观锁
public class Prod implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @Id
    @GeneratedValue(generator = "UUID")
    private Integer id;
    /**
     *
     */
    private Integer num;
    /**
     * 乐观锁版本
     */
    private BigDecimal version;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public BigDecimal getVersion() {
        return version;
    }

    public void setVersion(BigDecimal version) {
        this.version = version;
    }
}
